<?php
class gyxj_ai_generationsModel extends spModel
{
    public $pk = "gen_id";
    public $table = "gyxj_ai_generations";

    /**
     * 获取用户AI生成记录
     * @param string $user_id 用户ID
     * @param int $limit 条数限制
     * @return array
     */
    public function getUserGenerations($user_id, $limit = 10)
    {
        return $this->findAll(['user_id' => $user_id], 'created_at DESC', '*', $limit);
    }
}
?>